<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=yes">
    <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>服务号绑定</title>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/ajz/mobile/css/iconfont.css">
    <link type="text/css" rel="stylesheet" href="${ctxStatic}/ajz/mobile/css/wechatRegister.css" />
    <script type="text/javascript" src="${ctxStatic}/ajz/mobile/js/jquery.min.js"></script>
</head>
<body>
    <form action="userRegister" method="post" name="userRegister" id="userRegister" modelAttribute="user">
        <input type="hidden" id="openid" name="openid" value="${openid}"/>
        <div class="login_titile_bg" style="position: relative;right: 10px;">
            <img src="${ctxStatic}/ajz/mobile/img/linlne.png">
        </div>
        <ul class="login_iup">
            <li><span>负 责 人:</span><input type="text" maxlength="50" id="chargePerson" name="chargePerson" placeholder="请输入负责人姓名"/></li>
            <li><span>联系电话:</span><input type="text" maxlength="20" id="telephone" name="telephone" placeholder="请输入联系电话" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/></li>
        </ul>
        <div class="btn_x">
            <a onclick="return ckForm()" >绑 定</a>
        </div>
    </form>
</div>
<!--
<div class="inves_box_shax">
    <div class="inves_t">
        <img src="${ctxStatic}/ajz/img/timg.gif">
        <span>姓名不能为空</span>
        <a href="javascript:;" class="inves_a_btn">确定</a>
    </div>
</div>
<div class="inves_box_shax_1">
    <div class="inves_t">
        <img src="${ctxStatic}/ajz/img/timg.gif">
        <span>姓名不合法！</span>
        <a href="javascript:;" class="inves_a_btn_1">确定</a>
    </div>
</div>
<div class="inves_box_shax2">
    <div class="inves_t">
        <img src="${ctxStatic}/ajz/img/timg.gif">
        <span>手机号码不能为空</span>
        <a href="javascript:;" class="inves_a_btn2">确定</a>
    </div>
</div>
<div class="inves_box_shax2_1">
    <div class="inves_t">
        <img src="${ctxStatic}/ajz/img/timg.gif">
        <span>手机号码不合法！</span>
        <a href="javascript:;" class="inves_a_btn2_1">确定</a>
    </div>
</div>-->
<script>
    function ckForm(){
        var chargePerson = $("#chargePerson").val();
        var telephone = $("#telephone").val();
        $.ajax({
            url: "nameCheck",
            type: "POST",
            data: {chargePerson:chargePerson,telephone:telephone},
            dataType: "json",
            async: true,
            success:function(map){
                flag = map.flag;
                if(flag=='fail'){
                    alert("请检查您输入的信息是否有误！")
                }else{
                    alert("绑定成功！")
                    document.getElementById('userRegister').submit();
                }
            }
        })
    }
</script>

</body>
</html>

